#pragma once

#include <string>
#include <system_error>


#include "helper/sqlite/IDB.h"

namespace helper {
namespace sqlite {

// exists not impl
class AbstractDB : public IDB {
public:
  explicit AbstractDB(const std::string & url);
  ~AbstractDB() override;

  std::error_code destroy() override ;
protected:
  std::error_code _open() override;
  std::error_code _close() override ;

public:
  std::optional<Statement> createStatement(const std::string & sql, std::error_code & ec) const override;
  void * raw_handler() const override ;

private:
  void * _db;
};

bool isMemoryUrl(const std::string & url) ;

}// namespace helper
}// namespace sqlite
